<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>

        * {
            margin: 0;
            padding: 0;
        }

        .input-num {
            margin: 200px auto;
            width: 260px;
            height: 50px;
        }

        .input-num button {
            float: left;
            display: block;
            width: 80px;
            height: 50px;
            color: #ae2825;
            background-color: #c7c7c7;
            font-size: 30px;
            border: none;
            cursor: pointer;
        }

        .input-num #sub {
            border-bottom-left-radius: 8px;
            border-top-left-radius: 8px;
        }

        .input-num #add {
            border-bottom-right-radius: 8px;
            border-top-right-radius: 8px;
        }

        .input-num span {
            float: left;
            display: block;
            width: 98px;
            height: 48px;
            border: 1px solid #c7c7c7;
            text-align: center;
            line-height: 50px;
            font-size: 24px;
        }

    </style>
    <script src="./vue.js"></script>
</head>

<body>

    <div class="input-num">
        <button id="sub" @click="sub">-</button>
        <span v-text="num"></span>
        <button id="add" @click="add">+</button>
    </div>

    <script>

        var app = new Vue({
            el: ".input-num",
            data: {
                num: 0
            },
            methods: {
                add: function(e) {
                    this.num++;
                },
                sub: function(e) {
                    this.num--;
                }
            }
        });

    </script>

</body>
</html>